import { Link } from '@brillout/docpress'

From the perspective of a server, Vike is just a middleware:

```js
// renderPage() doesn't depend on Node.js and can be used within any JavaScript environment:
// Node.js, AWS, Cloudflare, Vercel, Deno, Bun, Lagon, ...
import { renderPage } from 'vike/server'

// Any server: Express.js, Cloudflare Worker, AWS Lambda Function, Fastify, Hono, Nitro, ...
server.addMiddleware({
  method: 'GET',
  route: '*', // catch-all
  async handler(request) {
    const pageContextInit = { urlOriginal: request.url }
    const pageContext = await renderPage(pageContextInit)
    // `body` is the HTML of the page with a route matching pageContextInit.urlOriginal
    const { body, statusCode, headers } = pageContext.httpResponse
    const response = { body, statusCode, headers }
    return response
  }
})
```

You can embed {(() => {const content = <code>renderPage()</code>; return props.noLink ? content : <Link href="/renderPage">{content}</Link> })()} into any server and any deployment environment.

> Alternatively, instead of using `renderPage()`, you can <Link text="pre-render" href="/pre-rendering" /> your pages and remove the need for a production server (and deploy to a <Link text="static host" href="/static-hosts" /> instead).
